package com.cpj.threadLocal;

import com.cpj.base.model.User;

public class UserThreadLocal {
    private UserThreadLocal(){
    }
    //ConsoleUserVo是存储用户信息的实体类我就不说了
    private static final ThreadLocal<User> LOCAL = new ThreadLocal<User>();

    public static void set(User user){
        LOCAL.set(user);
    }

    public static User get(){
        return LOCAL.get();
    }

    public static void remove(){
        LOCAL.remove();
    }
}
